package com.vhall.component.entity.data.vo;

import com.vhall.component.framework.common.annotation.ParamName;
import com.vhall.component.plugin.common.annotation.CheckTimeInterval;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 数据统计查询条件
 *
 * @author kainan.li
 * @date 2021/4/26
 */
@Data
@CheckTimeInterval
public class DataExportAdminParamVO implements Serializable {

    @ParamName("room_id")
    private String roomId;

    @ParamName("start_time")
    @NotBlank(message = "begin_time开始时间不能为空")
    @Pattern(message = "开始时间格式错误", regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$")
    private String startTime;

    @ParamName("end_time")
    @NotBlank(message = "end_time结束时间不能为空")
    @Pattern(message = "结束时间格式错误", regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\\s+([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$")
    private String endTime;

    @NotBlank(message = "不能为空")
    private String export;

    @Range(min = 0, max = 3, message = "status 应在0-3之间")
    private Integer status;

    @Range(min = 0)
    private Integer page;

    @ParamName("page_size")
    @Range(min = 1)
    private Integer pageSize;

    private String token;

    @ParamName("source_id")
    private String sourceId;
    private String accountId;

    private Integer offset;


}
